#pragma once
#include <QMutex> 
#include<map>
#include<functional>
#include <assert.h>
#include"InnerMsg.h"

class DMsgCenter
{
public:
	typedef std::function<bool(const void *)> MsgCallBack;

public:
	static DMsgCenter *getInstance();
	static void destoryInstance();
	~DMsgCenter();
	void registMsg(const InnerMsg,MsgCallBack &);
	bool handleMsg(const InnerMsg,const void *);

private:
	DMsgCenter();
	std::map<InnerMsg, MsgCallBack> m_msgMap;
	static DMsgCenter *m_pMsgCenter;
	static QMutex m_Mutex;
};

